package com.qf.servlet;

import com.qf.entity.User;
import com.qf.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author Ypl
 * @version V1.0
 * @Project September-mavens
 * @Package com.qf.servlet
 * @Description:
 * @Date 2022/9/30 21:00
 */
@Controller
public class Servlet {

    @Autowired
    UserService userService;

    @RequestMapping("/json")
    @ResponseBody
    public List<User> findAll(){
        List<User> all = userService.findAll();
        return all;
    }
}
